﻿
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace SpeedSearch
{
    public class VirtualizationPictureBox : PictureBox
    {
        private ImageList _imageList;
        private ToolTip _toolTip;

        public VirtualizationPictureBox()
            : base()
        {

        }

        /// <summary>
        /// Worker de virtualization
        /// </summary>
        private BackgroundWorker _worker;

        public VirtualizationPictureBox(ImageList imageList)
            : base()
        {
            this._imageList = imageList;
            this._toolTip = new ToolTip();
            this.Size = new Size(16, 16);

            this.Click += new System.EventHandler(this.OnClick);

            this._worker = new BackgroundWorker();
            _worker.DoWork += new DoWorkEventHandler(this._worker_DoWork);
            _worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this._worker_RunWorkerCompleted);
        }

        public void SetImageAndToolTip(string imageName, string toolTipText)
        {
            this.Image = this._imageList.Images[imageName];
            this._toolTip.SetToolTip(this, toolTipText);
        }

        private void OnClick(object sender, EventArgs e)
        {

        }

        #region Worker

        private void _worker_DoWork(object sender, DoWorkEventArgs e)
        {

        }

        private void _worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {

        }

        #endregion
    }
}
